package com.itmumu.miniwechat.user.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户联系人表
 * @TableName user_contact
 */
@TableName(value ="user_contact")
@Data
public class UserContact implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    private Integer uid;

    /**
     * 联系人ID或群组ID
     */
    private Integer contactId;

    /**
     * 联系人类型: 1=好友，2=群组
     */
    private Integer contactType;

    /**
     * 联系状态：1=非好友，2=已添加为好友
     */
    private Integer contactStatus;

    /**
     * 是否拉黑
     */
    private Integer isBlocked;

    /**
     * 拉黑操作人
     */
    private Integer blockedBy;

    /**
     * 添加来源
     */
    private Integer source;

    /**
     * 最后联系时间
     */
    private Integer lastContactTime;

    /**
     * 联系人备注1
     */
    private String remark1;

    /**
     * 联系人备注2
     */
    private String remark2;

    /**
     * 删除联系人的操作人
     */
    private Integer deletedBy;

    /**
     * 创建时间
     */
    private Long createTime;

    /**
     * 更新时间
     */
    private Long updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserContact other = (UserContact) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getContactId() == null ? other.getContactId() == null : this.getContactId().equals(other.getContactId()))
            && (this.getContactType() == null ? other.getContactType() == null : this.getContactType().equals(other.getContactType()))
            && (this.getContactStatus() == null ? other.getContactStatus() == null : this.getContactStatus().equals(other.getContactStatus()))
            && (this.getIsBlocked() == null ? other.getIsBlocked() == null : this.getIsBlocked().equals(other.getIsBlocked()))
            && (this.getBlockedBy() == null ? other.getBlockedBy() == null : this.getBlockedBy().equals(other.getBlockedBy()))
            && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
            && (this.getLastContactTime() == null ? other.getLastContactTime() == null : this.getLastContactTime().equals(other.getLastContactTime()))
            && (this.getRemark1() == null ? other.getRemark1() == null : this.getRemark1().equals(other.getRemark1()))
            && (this.getRemark2() == null ? other.getRemark2() == null : this.getRemark2().equals(other.getRemark2()))
            && (this.getDeletedBy() == null ? other.getDeletedBy() == null : this.getDeletedBy().equals(other.getDeletedBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getContactId() == null) ? 0 : getContactId().hashCode());
        result = prime * result + ((getContactType() == null) ? 0 : getContactType().hashCode());
        result = prime * result + ((getContactStatus() == null) ? 0 : getContactStatus().hashCode());
        result = prime * result + ((getIsBlocked() == null) ? 0 : getIsBlocked().hashCode());
        result = prime * result + ((getBlockedBy() == null) ? 0 : getBlockedBy().hashCode());
        result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
        result = prime * result + ((getLastContactTime() == null) ? 0 : getLastContactTime().hashCode());
        result = prime * result + ((getRemark1() == null) ? 0 : getRemark1().hashCode());
        result = prime * result + ((getRemark2() == null) ? 0 : getRemark2().hashCode());
        result = prime * result + ((getDeletedBy() == null) ? 0 : getDeletedBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", uid=").append(uid);
        sb.append(", contactId=").append(contactId);
        sb.append(", contactType=").append(contactType);
        sb.append(", contactStatus=").append(contactStatus);
        sb.append(", isBlocked=").append(isBlocked);
        sb.append(", blockedBy=").append(blockedBy);
        sb.append(", source=").append(source);
        sb.append(", lastContactTime=").append(lastContactTime);
        sb.append(", remark1=").append(remark1);
        sb.append(", remark2=").append(remark2);
        sb.append(", deletedBy=").append(deletedBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}